<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <title>报表数据审核页面</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="../../../../layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../../../../layuiadmin/style/admin.css" media="all">
  <link rel="stylesheet" href="../../../../layuiadmin/style/template.css" media="all">
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
</head>
<body style="background-color: #fff">
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div>
                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 5px;">
                    <legend>报表数据审核窗口</legend>
                </fieldset>
                <form class="layui-form layui-form-pane" method="post" id="form">
                    <input type="hidden" name="id" th:value="${plan.id}">
                    <input type="hidden" name="projectID" th:value="${plan.projectID}">


                    <div class="layui-form-item">
                        <label class="layui-form-label">填报项目</label>
                        <div class="layui-input-block">
                            <select name="projectID" >
                                <option value="">不限</option>
                                <option th:each="project:${projects}" th:value="${project.id}" th:selected="${plan.projectID} == ${project.id}">[[${project.name}]]</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">用人单位</label>
                        <div class="layui-input-inline" lay-filter="heading">
                            <select name="hId" id="first" lay-verify="required" lay-filter="heading">
                                <option value="请选择管理机构" disabled="">请选择管理机构</option>
                                <option value="0" th:selected="${category} == 0">管理部门</option>
                                <option value="1" th:selected="${category} == 1">教学部门</option>
                            </select>
                        </div>

                        <div class="layui-input-inline" lay-filter="footing">
                            <select name="unit" id="second" lay-filter="footing" lay-verify="required" lay-search="">
<!--                                <option value="0">请先选择管理机构</option>-->
                                <option th:value="${plan.unit}">[[${plan.unit}]]</option>

                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">学科专业</label>
                        <div class="layui-input-block">
                            <input type="text" name="profession" lay-verify="required" autocomplete="off" placeholder="学科专业" class="layui-input" th:value="${plan.profession}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">岗位类别</label>
                        <div class="layui-input-inline">
                            <select name="job" >
                                <option value="专技主体岗">专技主体岗</option>
                                <option value="专技辅助岗">专技辅助岗</option>
                            </select>
                        </div>
                        <label class="layui-form-label">招聘人数</label>
                        <div class="layui-input-inline">
                            <input type="text" name="hireNumber" lay-verify="required" autocomplete="off" placeholder="招聘人数" class="layui-input" th:value="${plan.hireNumber}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">已收简历</label>
                        <div class="layui-input-inline">
                            <input type="text" name="resume" lay-verify="required" autocomplete="off" placeholder="招聘人数" class="layui-input" th:value="${plan.resume}">
                        </div>
                        <label class="layui-form-label">已考核</label>
                        <div class="layui-input-inline">
                            <input type="text" name="assessment" lay-verify="required" autocomplete="off" placeholder="招聘人数" class="layui-input" th:value="${plan.assessment}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">已录用</label>
                        <div class="layui-input-block">
                            <input type="text" name="hired" lay-verify="required" autocomplete="off" placeholder="招聘人数" class="layui-input" th:value="${plan.hired}">
                        </div>
                    </div>



                    <div class="layui-form-item layui-hide" style="padding-left: 235px" >
                        <div class="layui-input-block">
                            <button type="button" id="submit" lay-filter="submit" lay-submit class="layui-btn">通 过</button>
                        </div>
                    </div>




                </form>
            </div>
        </div>
    </div>
</div>




    <script src="../../../../layuiadmin/layui/layui.js"></script>

<!--    文件的下载和删除操作-->
<script>
    // 文件的下载
    function dowloadFile(index) {
        var id = "file" + index;
        var path = document.getElementById(id).innerText
        window.open(path)
    }

</script>

    <script>
        layui.config({
            base: '../../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index','form', 'upload','layer','laydate'],function () {
            var $ = layui.$
            ,form = layui.form
            ,upload = layui.upload
            ,layer =  layui.layer

            form.on("select(heading)",function () {
                var hId = $("#first").val();
                // 删除option
                $('#second option').remove();
                // 添加第一项
                var second = $('#second');
                second.append('<option value=' + '选择部门' + '>' + '</option>');


                // 异步请求
                $.ajax({
                    type:"POST",
                    url:"/plan/particular/getDepart",
                    dataType:"JSON",
                    async:true,
                    data:{hId:hId},
                    success:function (res) {
                        console.log(res);
                        // 动态增加内容
                        for(var i = 0;i < res.length;i++){
                            $('#second').append('<option value='+res[i] + '>' + res[i] + '</option>');
                        }
                        // 重新渲染下拉框
                        form.render('select');
                    }
                })

            })

        });
    </script>
</body>
</html>